<template>
  <div id="banner">
    <van-swipe class="my-swipe"
               :autoplay="3000"
               indicator-color="white">
      <van-swipe-item v-for="(item,index) in bannerData"
                      :key="index">
        <img style="width:100%"
             :src="item.pic">
      </van-swipe-item>
    </van-swipe>
  </div>
</template>

<script>
import { getBanner } from "@/api/find";
export default {
  name: "banner",
  data () {
    return {
      bannerData: [],
    };
  },
  created () {
    getBanner().then(res => {
      this.bannerData = res.banners;
    })
  }
}
</script>

<style scoped>
#banner {
  width: 100%;
}
.van-swipe__track {
  height: 0;
}
img {
  border-radius: 14px;
}
</style>